package com.itheima.service;

import com.itheima.pojo.User;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

@Service
public class UserService {
    /**
     * 补充完成以下方法，如果用户的生日的星期数和今天一致，就是幸运用户
     */

    public Boolean isLucky(User user)  {

        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date(System.currentTimeMillis());
        System.out.println("当前星期:"+date.getDay());
System.out.println("用户星期:"+user.getBirthday().getDay());
if(user.getBirthday().getDay()==date.getDay())
    return true;
return false;
    }
}
